<div class="row">
	<div class="col-xs-12 col-md-12">
		<!-- widgets part -->
		<div class="widget">
			<div class="widget-header bordered-bottom bordered-themeprimary">
				<i class="widget-icon fa fa-tasks themeprimary"></i>
				<span class="widget-caption themeprimary">销售流水单详情</span>
				<div class="widget-buttons buttons-bordered">
					<%= button_to '编辑', edit_so_transaction_path(@so_transaction), method: :get, :class => "btn btn-blue btn-xs" %>
				</div>
			</div><!--Widget Header-->
			<div class="widget-body">
				<div class="widget-main no-padding">
					<p id="notice">
						<%= notice %>
					</p>
					<p>
						<strong>Customer:</strong>
						<%= @so_transaction.customer.name %>
					</p>

					<p>
						<strong>Amount:</strong>
						<%= @so_transaction.amount %>
					</p>

					<p>
						<strong>Date:</strong>
						<%= @so_transaction.date %>
					</p>
					<p>
						<strong>备注:</strong>
						<%= @so_transaction.comment %>
					</p>

				</div><!--Widget Main Container-->
			</div><!--Widget Body-->
		</div>

		<!-- widgets part -->
		<div class="widget">
			<div class="widget-header bordered-bottom bordered-themeprimary">
				<i class="widget-icon fa fa-tasks themeprimary"></i>
				<span class="widget-caption themeprimary">付款分配</span>
				<%= render "order_search_form"%>
			</div><!--Widget Header-->
			<div class="widget-body">
				<div class="widget-main no-padding">

					<div id="order-list">

					</div>

					<table class="table table-bordered table-striped table-condensed flip-content">
						<thead class="flip-content bordered-palegreen">
							<tr>
								<th>日期</th>
								<th>订单号</th>
								<th>客户订单号</th>
								<th>金额</th>

							</tr>
						</thead>

						<tbody>
							<% total = 0 %>
							<% @payments.each do |payment| %>
							<tr>
								<td><%= payment.date %></td>
								<td><%= payment.order.order_code %></td>
								<td><%= payment.order.customer_po %></td>
								<td><%= payment.amount %></td>
							</tr>
							<% total += payment.amount %>
							<% end %>
						</tbody>
						<tfoot>
							<tr>
								<th colspan="3">合计</th>
								<th><%= total %></th>
							</tr>
							
						</tfoot>
					</table>

				</div><!--Widget Main Container-->
			</div><!--Widget Body-->
		</div>
		
		
		
	</div>
</div>

